import lib.modula.HintWindow;

var hint:HintWindow;

function getTimestamp():Number 
{
	var date:Date = new Date();
	var timestamp = date.getTime();
	delete date;
	return timestamp;
}

function under2Minus(uuid:String):String
{
	var items:Array = uuid.split("_");
	return items[0]+"-"+items[1]+"-"+items[2]+"-"+items[3]+"-"+items[4];
}

function minus2Under(uuid:String):String
{
	var items:Array = uuid.split("-");
	return items[0]+"_"+items[1]+"_"+items[2]+"_"+items[3]+"_"+items[4];
}

function createHint(target:MovieClip, content:String, container:MovieClip)
{
	hint=new HintWindow(target, container, content, true);
	hint.fadeIn(0,1);
}

function removeHint()
{
	if (hint!=null)
	{
		hint.hide();
		hint.removeMovieClip();
	}
	else return;
}

function getHttpBaseUrl():String
{
	var conf=Packages.system.MLF.loadConfiguration();
	return "http://"+conf.host+"/"+conf.app;
}

function time2String(time:Number, pattern:String):String
{
	if (time==null) return "";
	if (pattern=="MM:SS")
	{
		var min:Number=Math.floor(time/60);
		var sec:Number=time-min*60;
		var minStr:String=min<10?"0"+min:min;
		return minStr+":"+sec;

	} else
	{
		return "";
	}
}